<?php
date_default_timezone_set("PRC");
//header("Content-type: text/html; charset=utf-8");
require_once('jpgraph/jpgraph.php');
require_once('jpgraph/jpgraph_pie.php');
require_once('jpgraph/jpgraph_pie3d.php');
$male=$_GET['male'];
$female=$_GET['female'];
$data=array($male,$female);
$data2=array("male","female");


$graph=new pieGraph(600,300);
$graph->img->SetMargin(30,30,80,40);


//设置图表的标题字体、大小
$graph->title->Set(iconv("UTF-8","GB2312//IGNORE","male / female %"));

//和上面标题对应，设置标题的字体和大小
//$graph->title->SetFont(FF_SIMSUN,FS_BOLD,20);


$pie3dplot=new piePlot3d($data);  //定义饼图
$pie3dplot->SetLegends($data2);
$graph->legend->Pos(0.01,0.9,"left","center");

$graph->legend->SetFrameWeight(1);  
$graph->legend->SetColumns(4); 

$graph->Add($pie3dplot);
//$graph->title->setfont(FF_SIMSUN);   //解决中文（标题）乱码问题
$graph->Stroke();
?>
